Termination w.r.t. Q of the following Term Rewriting System could be proven:

Q restricted rewrite system:
The TRS R consists of the following rules:

f(x, nil) → g(nil, x)
f(x, g(y, z)) → g(f(x, y), z)
++(x, nil) → x
++(x, g(y, z)) → g(++(x, y), z)
null(nil) → true
null(g(x, y)) → false
mem(nil, y) → false
mem(g(x, y), z) → or(=(y, z), mem(x, z))
mem(x, max(x)) → not(null(x))
max(g(g(nil, x), y)) → max'(x, y)
max(g(g(g(x, y), z), u)) → max'(max(g(g(x, y), z)), u)

Q is empty.


QTRS
  ↳ DirectTerminationProof

Q restricted rewrite system:
The TRS R consists of the following rules:

f(x, nil) → g(nil, x)
f(x, g(y, z)) → g(f(x, y), z)
++(x, nil) → x
++(x, g(y, z)) → g(++(x, y), z)
null(nil) → true
null(g(x, y)) → false
mem(nil, y) → false
mem(g(x, y), z) → or(=(y, z), mem(x, z))
mem(x, max(x)) → not(null(x))
max(g(g(nil, x), y)) → max'(x, y)
max(g(g(g(x, y), z), u)) → max'(max(g(g(x, y), z)), u)

Q is empty.

We use [23] with the following order to prove termination.

Lexicographic path order with status [19].
Quasi-Precedence:
f2 > nil > [null1, true] > or2
f2 > nil > false > or2
f2 > [g2, ++2] > false > or2
f2 > [g2, ++2] > [mem2, =2] > or2
f2 > [g2, ++2] > max1 > [null1, true] > or2
f2 > [g2, ++2] > max1 > not1 > or2
f2 > [g2, ++2] > max'2 > or2
u > [g2, ++2] > false > or2
u > [g2, ++2] > [mem2, =2] > or2
u > [g2, ++2] > max1 > [null1, true] > or2
u > [g2, ++2] > max1 > not1 > or2
u > [g2, ++2] > max'2 > or2

Status:
max'2: [2,1]
++2: [2,1]
or2: [2,1]
=2: [2,1]
mem2: [2,1]
nil: multiset
max1: [1]
true: multiset
g2: [2,1]
u: multiset
false: multiset
f2: [2,1]
null1: [1]
not1: [1]